<%@ page import="com.atnjupt.bean.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: WIzarder
  Date: 2021/5/31
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <%
            Person p = new Person();
            p.setAge(19);
            p.setName("刘德华");
            List<String> city = new ArrayList<>();
            city.add("北京");
            city.add("天津");
            city.add("南京");
            p.setCity(city);
            p.setPhone(new String[]{"1886899553","1996637561","1923457231"});
            Map<String,Object> map = new HashMap<>();
            map.put("key1","value1");
            map.put("key2","value2");
            map.put("key3","value3");
            p.setMap(map);
            pageContext.setAttribute("p",p);
        %>
<%--        获取的属性值是按照javabean里面的get方法获取的--%>
        输出p:${p}<br/>
        p这个对象的age属性值：${p.age}<br/>
        p这个对象的name属性值：${p.name}<br/>
        p这个对象的City集合：${p.city }<br/>
        p这个对象的city中的某个值：${p.city[0]}<br/>
        p这个对象的Map集合：${p.map}<br/>
        p这个对象的phone中的某个值:${p.phone[1]}<br/>
        p这个对象的map中的某个值:${p.map.key1}<br/>
</body>
</html>
